#include <bits/stdc++.h>
using namespace std;
int main() {

  deque<int> Q;
  int q;
  cin >> q;
  while (q--) {

    int t;
    cin >> t;
    if (t == 1) {
      int c, x;
      cin >> c >> x;
      for (int i = 1; i <= c; i++) {
        Q.push_back(x);
      }

    } else {
      int k;
      cin >> k;
      int sum = 0;
      for (int i = 1; i <= k; i++) {
        int t = Q.front();
        sum += t;
        Q.pop_front();
      }
      cout << sum << endl;
    }
  }
  return 0;
}
